//tassa versiossa Calendar on muutettu luokaksi Kalenteri

package studentcalendar;

import java.util.Date;

/**
 *
 * @author Samu
 */
public class Course {

    private String name;
    private Date startDate, endDate;

    public Course(String name, Date startDate, Date endDate) {
        if (name == null) {
            throw new NullPointerException("Name must not be null.");
        }
        if (name.equals("")) {
            throw new IllegalArgumentException("Name must not be empty.");
        }
        if (startDate == null) {
            throw new NullPointerException("Start date must not be null.");
        }
        if (endDate == null) {
            throw new NullPointerException("End date must not be null.");
        }
        if (endDate.before(startDate)) {
            throw new IllegalArgumentException("End date must not be before start date.");
        }
        this.name = name;
        this.startDate = startDate;
        this.endDate = endDate;
    }

    public String getName() {
        return name;
    }

    public Date getStartDate() {
        return startDate;
    }

    public Date getEndDate() {
        return endDate;
    }
}
